<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});


//USERS 路由部分(qiqi) 后台路由

Route::group(['middleware' => 'adminlogin'],function(){

    //后台用户模块
//添加用户
Route::get('admin/user/add','Admin\User\UsersController@add');

//添加用户提交表单
Route::post('admin/user/insert','Admin\User\UsersController@insert');

//用户列表
Route::get('admin/user/list',  'Admin\User\UsersController@userlist');

//修改用户状态
Route::post('admin/user/status', 'Admin\User\UsersController@alterStatus');

//删除用户
Route::get('admin/user/delete/{id}', 'Admin\User\UsersController@delete');

//显示用户详情
Route::get('admin/user/detail/{id}', 'Admin\User\UsersController@detail');

//管理员详情
Route::get('admin/user/admindetail/{id}', 'Admin\User\UsersController@admindetail');

//管理员列表
Route::get('admin/user/adminlist', 'Admin\User\UsersController@adminlist');

//管理员编辑
Route::get('/admin/user/edit/{id}', 'Admin\User\UsersController@edit');

//管理员编辑
Route::post('/admin/user/doedit', 'Admin\User\UsersController@doedit');

//删除管理员
Route::get('admin/user/deleteadmin/{id}', 'Admin\User\UsersController@deleteadmin');

//后台用户注销
Route::get('admin/quit', 'Admin\User\UsersController@quit');

});

//后台主页
Route::get('/admin/index','Admin\IndexController@index');

//后台用户模块

//用户登录
Route::get('/admin/login', 'Admin\LoginController@login');

//验证码 
Route::get('/admin/captcha/{tmp}', 'CodeController@captcha');

//提交登录信息
Route::post('/admin/dologin', 'Admin\LoginController@dologin');



//前台路由部分
//前台主页
Route::get('home/index','Home\IndexController@index');

//前台登录
Route::get('home/login', 'Home\Login\LoginController@login');

//前台登录验证
Route::post('/home/dologin', 'Home\Login\LoginController@dologin');

//前台登录
Route::post('/home/user/register', 'Home\User\UserController@register');

// 前台登出
Route::get('/home/quit', 'Home\Login\LoginController@quit');


//收货地址
Route::get('/home/address', 'Home\Address\AddressController@address');

//添加收货地址
Route::post('/home/address/add', 'Home\Address\AddressController@add');

//修改用户默认地址
Route::get('/home/address/status/{id}', 'Home\Address\AddressController@status');

//编辑收货地址
Route::post('/home/address/edit', 'Home\Address\AddressController@edit');

//删除收货地址
Route::get('/home/address/delete/{id}', 'Home\Address\AddressController@delete');

//编辑个人信息
Route::get('/home/user/detail', 'Home\User\UserController@detail');

Route::post('/home/user/edit', 'Home\User\UserController@edit');


//修改密码
Route::get('/home/user/password', 'Home\User\UserController@password');
Route::post('/home/user/dopassword', 'Home\User\UserController@dopassword');

//找回密码
Route::post('/home/user/retpassword', 'Home\User\UserController@retpassword');

Route::get('/home/password/reset/{id}/{remember_token}' ,'Home\User\UserController@resetpassword');

//找回密码邮件返回部分
Route::get('/home/forget/defeat', 'Home\User\UserController@defeat');

Route::post('/home/forget/win', 'Home\User\UserController@win');










































































//shunshun 路由  商品模块
//商品列表展示页面路由
Route::get('admin/goods/list','Admin\Goods\GoodsController@index');

//商品添加页面展示
Route::get('admin/goods/add','Admin\Goods\GoodsController@add');
//添加数据
Route::post('admin/goods/insert','Admin\Goods\GoodsController@insert');
//AJAX实现显示类型属性
Route::post('admin/goods/ajaxAttribute','Admin\Goods\GoodsController@ajaxAttribute');
//AJAX实现改变上架状态
Route::post('admin/goods/ajaxTop','Admin\Goods\GoodsController@ajaxTop');
//商品编辑页面展示
Route::get('admin/goods/edit/{id}','Admin\Goods\GoodsController@edit');

//商品编辑实现
Route::post('admin/goods/update/{id}','Admin\Goods\GoodsController@update');
//商品库存量展示
Route::get('admin/goods/show/{id}','Admin\Goods\GoodsController@show');
//商品库存量实现
Route::post('admin/goods/number/{id}','Admin\Goods\GoodsController@number');

//商品删除功能实现
Route::get('admin/goods/delete/{id}','Admin\Goods\GoodsController@delete');
//使用ajax实现商品属性的删除
Route::post('admin/goods/ajaxDelAttr/{id}','Admin\Goods\GoodsController@ajaxDelAttr');

//分类列表
Route::controller('admin/category','Admin\Category\CategoryController');
//类型列表
Route::controller('admin/type','Admin\Type\TypeController');
//类型属性
Route::controller('admin/attribute','Admin\Attribute\AttributeController');




//前台商品模块
//商品详情页面展示
Route::get('home/goods/index/{id}/{attr}','Home\Goods\GoodsController@index');

//商品搜索页的展示
Route::get('home/goods/search/{id}/{paixu}','Home\Search\SearchController@index');
//根据搜索内容展示搜索页

Route::get('home/goods/series/{paixu}','Home\Search\SearchController@search');

//商品评论页面
Route::get('home/goods/pl/{id}','Home\Pl\GoodsPlController@index');
//发表评论
Route::post('home/goods/goodspl/{id}','Home\Pl\GoodsPlController@pl');





































































































//订单模块
Route::get('admin/order/index', 'Admin\order\IndexController@index');
//订单详情
Route::get('admin/order/orderdetail/{id}/{goods_id}', 'Admin\order\IndexController@orderdetail');
Route::post('admin/order/ajaxPay', 'Admin\order\IndexController@ajaxPay');
//发货
Route::post('admin/order/ajaxSend', 'Admin\order\IndexController@ajaxSend');

//前台订单
Route::get('home/order/order', 'Home\order\orderController@index');
Route::post('home/order/order', 'Home\order\orderController@postOrder');
Route::post('home/order/ajaxOrder', 'Home\order\orderController@ajaxPay');
//取消订单
Route::get('home/order/delete/{id}', 'Home\order\orderController@delete');
//订单列表支付
Route::get('home/order/orderpay/{id}', 'Home\order\orderController@orderpay');
//确认收货
Route::get('home/order/sure/{id}', 'Home\order\orderController@sure');
//申请退款
Route::get('home/order/saleReturn/{id}', 'Home\order\orderController@saleReturn');
//退货列表
Route::get('home/order/saleReturn', 'Home\order\orderController@indexReturn');


//订单详情
Route::get('home/order/orderdetail/{id}', 'Home\order\orderController@orderdetail');
//订单结算中心
Route::post('home/order/center', 'Home\order\orderController@center');

//收银台
Route::post('home/order/checkstand', 'Home\order\orderController@checkstand');

//收藏
Route::get('home/collect/index', 'Home\collect\collectController@index');
//添加收藏
Route::post('home/collect/ajaxCollect', 'Home\collect\collectController@ajaxCollect');

//删除收藏
Route::get('home/collect/delete/{id}', 'Home\collect\collectController@delete');
//购物车
Route::post('home/shopCar/shopCar', 'Home\shopCar\shopCarController@index');
Route::get('home/shopCar/shopCar', 'Home\shopCar\shopCarController@gindex');

Route::post('home/shopCar/ajaxUpdate', 'Home\shopCar\shopCarController@ajaxUpdate');
//删除购物车内商品
Route::get('home/shopCar/delete/{id}', 'Home\shopCar\shopCarController@delete');

//公告管理
Route::get('admin/notice/index', 'Admin\notice\IndexController@index');
Route::get('admin/notice/add', 'Admin\notice\IndexController@add');
Route::post('admin/notice/insert', 'Admin\notice\IndexController@insert');
Route::get('admin/notice/edit/{id}', 'Admin\notice\IndexController@edit');
Route::post('admin/notice/update/{id}', 'Admin\notice\IndexController@update');
Route::get('admin/notice/delete/{id}', 'Admin\notice\IndexController@delete');




















